﻿package net.wangit.adm.org;

import java.util.HashMap;
import java.util.Map;

import net.wangit.adm.role.PrivilegeTreeFactory;
import net.wangit.user.org.Org;
import net.wangit.user.org.OrgFactory;


public class OrgPrivilegeTreeFactory extends PrivilegeTreeFactory {

	public OrgPrivilegeTreeFactory() {
	}

	protected String getDomain() {
		return OrgPrivilegeUI.getAndSetDomain();
	}

	protected Map getPrivileges() throws Exception {
		String oid = OrgPrivilegeUI.getAndSetOrganizationId();
		Org organization = OrgFactory.getOrg(oid);
		return ((Map) (organization != null ? organization.getPrivileges()
				: new HashMap()));
	}

	protected boolean isDisabled() {
		return true;
	}
}
